﻿<?php if (user_is_anonymous()): ?>
  <div class="login-container animated fadeInDown">
    <?php if ($primary_local_tasks): ?>
      <?php print render($primary_local_tasks); ?>
    <?php endif; ?>
    <div class="loginbox bg-white">
      <?php if ($messages): ?>
        <div class="loginbox-textbox">
          <div id="console" class="clearfix">
            <?php print $messages; ?>
          </div>
        </div>
      <?php endif; ?>
      <div class="loginbox-textbox">
        <?php print render($page['content']); ?>
      </div>
    </div>
    <div class="logobox">
      <?php if ($logo): ?>
        <img id="logo" width="100%"
             src="<?php print $logo ?>?<?php echo variable_get('css_js_query_string') ?>"
             alt="<?php print $site_name ?>"/>
      <?php endif; ?>
    </div>
  </div>

<?php else: ?>
  <?php
  $path = drupal_get_path('theme', 'adminsosyuki');
  if (user_is_anonymous()) {
    drupal_add_js($path . '/js/toLogin.js');
  }
  ?>
  <!--  /Loading Container -->
  <!-- Navbar -->
  <div class="navbar">
    <div class="navbar-inner">
      <div class="navbar-container">
        <!-- Navbar Barnd -->
        <div class="navbar-header pull-left">
          <a href="/" class="navbar-brand">
            <small>
              <?php if ($logo): ?>
                <img id="logo"
                     src="<?php print $logo ?>?<?php echo variable_get('css_js_query_string') ?>"
                     alt="<?php print $site_name ?>"/>
              <?php endif; ?>
            </small>
          </a>
        </div>
        <!-- /Navbar Barnd -->
        <!-- Sidebar Collapse -->
        <div class="sidebar-collapse" id="sidebar-collapse">
          <i class="collapse-icon fa fa-bars"></i>
        </div>
        <!-- /Sidebar Collapse -->
        <!-- Account Area and Settings --->
        <div class="navbar-header pull-right">
          <div class="navbar-account">

            <ul class="account-area">
              <li>
                <a class="login-area dropdown-toggle"
                   data-toggle="dropdown">
                  <section>
                    <h2><span class="profile"
                              style="display: initial;">
                                            <span>当前用户 : <?php echo format_username($user); ?></span>
                                        </span>
                    </h2>
                  </section>
                </a>
                <!--Login Area Dropdown-->
                <ul
                  class="pull-right dropdown-menu dropdown-arrow dropdown-login-area">
                  <li class="username">
                    <a><?php echo format_username($user); ?></a>
                  </li>
                  <!--Theme Selector Area-->
                  <li class="theme-area">
                    <ul class="colorpicker" id="skin-changer">
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#5DB2FF;"
                             rel="/<?php echo $path; ?>/assets/css/skins/blue.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#2dc3e8;"
                             rel="/<?php echo $path; ?>/assets/css/skins/azure.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#03B3B2;"
                             rel="/<?php echo $path; ?>/assets/css/skins/teal.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#53a93f;"
                             rel="/<?php echo $path; ?>/assets/css/skins/green.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#FF8F32;"
                             rel="/<?php echo $path; ?>/assets/css/skins/orange.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#cc324b;"
                             rel="/<?php echo $path; ?>/assets/css/skins/pink.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#AC193D;"
                             rel="/<?php echo $path; ?>/assets/css/skins/darkred.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#8C0095;"
                             rel="/<?php echo $path; ?>/assets/css/skins/purple.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#0072C6;"
                             rel="/<?php echo $path; ?>/assets/css/skins/darkblue.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#585858;"
                             rel="/<?php echo $path; ?>/assets/css/skins/gray.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#474544;"
                             rel="/<?php echo $path; ?>/assets/css/skins/black.min.css"></a>
                      </li>
                      <li><a class="colorpick-btn" href="#"
                             style="background-color:#001940;"
                             rel="/<?php echo $path; ?>/assets/css/skins/deepblue.min.css"></a>
                      </li>
                    </ul>
                  </li>
                  <!--/Theme Selector Area-->
                  <li class="dropdown-footer">
                    <a href="/user/logout">
                      退出登录
                    </a>
                  </li>
                </ul>
                <!--/Login Area Dropdown-->
              </li>
            </ul>

            <div class="setting">
              <a id="btn-setting" title="Setting" href="#">
                <i class="icon glyphicon glyphicon-cog"></i>
              </a>
            </div>
            <div class="setting-container">
              <label>
                <input type="checkbox" id="checkbox_fixednavbar">
                <span class="text">锁定导航条</span>
              </label>
              <label>
                <input type="checkbox" id="checkbox_fixedsidebar">
                <span class="text">锁定左边栏</span>
              </label>
              <label>
                <input type="checkbox"
                       id="checkbox_fixedbreadcrumbs">
                <span class="text">锁定面包屑</span>
              </label>
              <label>
                <input type="checkbox" id="checkbox_fixedheader">
                <span class="text">锁定头部</span>
              </label>
            </div>
            <!-- Settings -->
          </div>
        </div>
        <!-- /Account Area and Settings -->
      </div>
    </div>
  </div>
  <!-- /Navbar -->
  <!-- Main Container -->
  <div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">

      <!-- Page Sidebar -->
      <div
        class="page-sidebar <?php echo empty($sidebar_menu) ? 'menu-compact' : ''; ?>"
        id="sidebar">

        <!-- Page Sidebar Header-->
        <div class="sidebar-header-wrapper">
          <input type="text" class="searchinput"/>
          <i class="searchicon fa fa-search"></i>
          <div class="searchhelper">这个并没有什么用,仅仅是好看.
          </div>
        </div>
        <!-- /Page Sidebar Header -->

        <?php if (!empty($sidebar_menu)): ?>
          <!-- Sidebar Menu -->
          <?php include_once "sidebar-menu.php"; ?>
          <!-- /Sidebar Menu -->
        <?php endif; ?>
      </div>

      <!-- /Page Sidebar -->

      <!-- Page Content -->
      <div class="page-content">
        <!-- Page Breadcrumb -->
        <div class="page-breadcrumbs">
          <?php print $breadcrumb; ?>
        </div>
        <!-- /Page Breadcrumb -->
        <!-- Page Header -->
        <div class="page-header position-relative">
          <div class="header-title">
            <?php print render($title_prefix); ?>

            <?php if ($title): ?>
              <h1><?php print $title; ?></h1>
            <?php else: ?>
              <?php print $breadcrumb; ?>
            <?php endif; ?>

            <?php print render($title_suffix); ?>

          </div>
          <!--Header Buttons-->
          <div class="header-buttons">
            <a class="sidebar-toggler" href="#">
              <i class="fa fa-arrows-h"></i>
            </a>
            <a class="refresh" id="refresh-toggler" href="">
              <i class="glyphicon glyphicon-refresh"></i>
            </a>
            <a class="fullscreen" id="fullscreen-toggler" href="#">
              <i class="glyphicon glyphicon-fullscreen"></i>
            </a>
          </div>
          <!--Header Buttons End-->
        </div>
        <!-- /Page Header -->
        <!-- Page Body -->
        <div class="page-body">


          <div class="tabbable">

            <?php if ($primary_local_tasks): ?>
              <?php echo render($primary_local_tasks); ?>
            <?php endif; ?>

            <div class="tab-content">

              <div class="tabbable">

                <?php if (!empty(render($secondary_local_tasks))): ?>
                  <?php echo render($secondary_local_tasks); ?>
                <?php endif; ?>

                <?php if (!empty(render($secondary_local_tasks))): ?>
                <div class="tab-content">
                  <?php endif; ?>
                  <?php if ($action_links): ?>
                    <div class="action-links">
                      <?php
                      print render($action_links); ?>
                    </div>
                  <?php endif; ?>

                  <div id="page">

                    <div id="content" class="clearfix">

                      <div id="content-wrapper">

                        <div id="main-content">
                          <?php if ($messages): ?>
                            <div id="console"
                                 class="clearfix">
                              <?php print $messages; ?>
                            </div>
                          <?php endif; ?>

                          <?php if ($page['help']): ?>
                            <div id="help">
                              <?php print render($page['help']); ?>
                            </div>
                          <?php endif; ?>

                          <?php print render($page['content']); ?>
                        </div>

                      </div>

                    </div>


                  </div>
                  <?php if (!empty(render($secondary_local_tasks))): ?>
                </div>
              <?php endif; ?>
              </div>
            </div>

          </div>

        </div>
        <!-- /Page Body -->
      </div>
      <!-- /Page Content -->
    </div>
    <!-- /Page Container -->
    <!-- Main Container -->

  </div>
<?php endif; ?>
